﻿using System;
using UnityEngine;

// Token: 0x020005B0 RID: 1456
public class AssetBundleLoadAssetOperationFull : global::AssetBundleLoadAssetOperation
{
	// Token: 0x06002258 RID: 8792 RVA: 0x00136FA0 File Offset: 0x001351A0
	public AssetBundleLoadAssetOperationFull(string bundleName, string assetName, Type type, string manifestAssetBundleName)
	{
		this.m_AssetBundleName = bundleName;
		this.m_AssetName = assetName;
		this.m_Type = type;
		this.m_ManifestAssetBundleName = manifestAssetBundleName;
	}

	// Token: 0x06002259 RID: 8793 RVA: 0x00136FC8 File Offset: 0x001351C8
	public override bool IsEmpty()
	{
		return this.m_Request == null || !this.m_Request.isDone || this.m_Request.asset == null;
	}

	// Token: 0x0600225A RID: 8794 RVA: 0x00136FFC File Offset: 0x001351FC
	public override T GetAsset<T>()
	{
		if (this.m_Request != null && this.m_Request.isDone)
		{
			return this.m_Request.asset as T;
		}
		return (T)((object)null);
	}

	// Token: 0x0600225B RID: 8795 RVA: 0x00137038 File Offset: 0x00135238
	public override T[] GetAllAssets<T>()
	{
		if (this.m_Request != null && this.m_Request.isDone)
		{
			T[] array = new T[this.m_Request.allAssets.Length];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = (this.m_Request.allAssets[i] as T);
			}
			return array;
		}
		return null;
	}

	// Token: 0x0600225C RID: 8796 RVA: 0x001370A8 File Offset: 0x001352A8
	public override bool Update()
	{
		if (this.m_Request != null)
		{
			return false;
		}
		global::LoadedAssetBundle loadedAssetBundle = global::AssetBundleManager.GetLoadedAssetBundle(this.m_AssetBundleName, out this.m_DownloadingError, this.m_ManifestAssetBundleName);
		if (loadedAssetBundle != null)
		{
			if (loadedAssetBundle.m_AssetBundle)
			{
				if (string.IsNullOrEmpty(m_AssetName))
				{
					this.m_Request = loadedAssetBundle.m_AssetBundle.LoadAllAssetsAsync(this.m_Type);
				}
				else
				{
					this.m_Request = loadedAssetBundle.m_AssetBundle.LoadAssetAsync(this.m_AssetName, this.m_Type);
				}
			}
			return false;
		}
		return true;
	}

	// Token: 0x0600225D RID: 8797 RVA: 0x0013713C File Offset: 0x0013533C
	public override bool IsDone()
	{
		if (this.m_Request == null && this.m_DownloadingError != null)
		{
			global::Debug.LogError(this.m_DownloadingError);
			return true;
		}
		return this.m_Request != null && this.m_Request.isDone;
	}

	// Token: 0x04002B4C RID: 11084
	protected string m_AssetBundleName;

	// Token: 0x04002B4D RID: 11085
	protected string m_AssetName;

	// Token: 0x04002B4E RID: 11086
	protected string m_DownloadingError;

	// Token: 0x04002B4F RID: 11087
	protected Type m_Type;

	// Token: 0x04002B50 RID: 11088
	protected AssetBundleRequest m_Request;

	// Token: 0x04002B51 RID: 11089
	protected string m_ManifestAssetBundleName;
}
